﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Exentials.Snw.SnwConnector;

namespace CodeGenerationSample
{
    class Program
    {
        static void Main(string[] args)
        {

            Exentials.Snw.SnwConnector.SnwConnection con = null;

            //con = new SnwConnection(<Host>, <SysNumber>, <Client>, <rfcusername>, <password>, <language>);

            con.Open();

            Exentials.Snw.CodeGenerator.SnwCode code = new Exentials.Snw.CodeGenerator.SnwCode(con);

            code.CreateFunctionCode("BAPI_PO_CREATE1");

            // C# code generation
            System.CodeDom.Compiler.CodeGeneratorOptions options = new System.CodeDom.Compiler.CodeGeneratorOptions();
            options.BracingStyle = "C";
            code.CreateCode("", System.CodeDom.Compiler.CodeDomProvider.CreateProvider("CSharp"), options);

            // VB.net code generation
            code.CreateCode("", System.CodeDom.Compiler.CodeDomProvider.CreateProvider("VB"), null);

            con.Close();
        }
    }
}
